<?php

namespace common\entities\outstock;

use Yii;

/**
 * This is the model class for table "myscrm_delivery_flow_record".
 *
 * @property integer $flow_record_id
 * @property string $delivery_guid
 * @property string $todo_guid
 * @property string $operator_guid
 * @property string $operator_name
 * @property string $created_on
 * @property integer $action
 * @property integer $is_success
 * @property string $remarks
 * @property string $operator_buname
 * @property string $operator_buguid
 */
class MyscrmDeliveryFlowRecordEntity extends \common\entities\ContractEntity
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'myscrm_delivery_flow_record';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('contractDB');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['created_on'], 'safe'],
            [['action', 'is_success'], 'integer'],
            [['delivery_guid', 'sub_order_id', 'operator_guid', 'operator_buguid'], 'string', 'max' => 36],
            [['operator_name', 'operator_buname'], 'string', 'max' => 50],
            [['remarks'], 'string', 'max' => 500]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'flow_record_id' => '操作流水记录id',
            'delivery_guid' => '出库单id',
            'sub_order_id' => '待办guid',
            'operator_guid' => '操作人guid',
            'operator_name' => '操作人姓名',
            'created_on' => 'Created On',
            'action' => '操作对应的数值',
            'is_success' => '是否操作成功，1=成功，0=不成功',
            'remarks' => '备注',
            'operator_buname' => '操作人所属区域',
            'operator_buguid' => '操作人所在区域id',
        ];
    }
}
